package com.apps.essentials;

import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;

public class AddUserLocationOverlay2 extends MyLocationOverlay{

	private Handler handler;
	private Context con;
	public AddUserLocationOverlay2(Context context, MapView mapview) {
		super(context, mapview);
		// TODO Auto-generated constructor stub
		con = context;
	}

	@Override
	public boolean onTap(GeoPoint gp, MapView mapview) {
		// TODO Auto-generated method stub
	    // Creating a Message object to send to Handler
	    Message message = new Message();
	    
	    // Creating a Bundle object ot set in Message object
	    Bundle data = new Bundle();
	    
	    // Setting latitude in Bundle object
	    data.putInt("latitude", gp.getLatitudeE6());
	    
	    // Setting longitude in the Bundle object
	    data.putInt("longitude", gp.getLongitudeE6());
	    
	    // Setting the Bundle object in the Message object
	    message.setData(data);
	    
	    // Sending Message object to handler
	    handler.sendMessage(message);		
		return super.onTap(gp, mapview);
	}
}
